package com.cw.base.jeeyc.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cw.base.common.model.dto.response.CommonRespDto;
import com.cw.base.jeeyc.biz.intf.DeployDictQueryBiz;
import com.cw.base.jeeyc.deploy.dto.DeployDictDto;
import com.cw.base.jeeyc.deploy.intf.DeployDictQueryApi;

/**
 * 数据字典
 *
 * @author chenw
 * @date 2019-08-26 21:21:57
 */
@RestController
@RequestMapping("/v1/deployDictQuery")
public class DeployDictQueryApiImpl implements DeployDictQueryApi {
    @Autowired
    private DeployDictQueryBiz deployDictBiz;

    /**
     * 分页查询数据字典
     *
     * @param request 条件
     * @return PageInfo<DeployDictDto>
     */
    @Override
    public CommonRespDto<Page<DeployDictDto>> selectPage(@RequestBody DeployDictDto request) {
        Page<DeployDictDto> pageInfo = deployDictBiz.selectPage(request);
        return CommonRespDto.<Page<DeployDictDto>>builder()
            .data(pageInfo)
            .build();
    }

    /**
     * 查询数据字典详情信息
     *
     * @param request 条件
     * @return DeployDictDto
     */
    @Override
    public CommonRespDto<DeployDictDto> queryDetail(@RequestBody DeployDictDto request) {
        DeployDictDto deployDictDto = deployDictBiz.queryDetail(request);
        return CommonRespDto.<DeployDictDto>builder()
            .data(deployDictDto)
            .build();
    }
}
